// 
// 
// 

package com.ssm.service.impl;

import com.ssm.po.Department;

import java.util.List;
import javax.annotation.Resource;
import com.ssm.mapper.DepartmentMapper;
import org.springframework.stereotype.Service;
import com.ssm.service.DepartmentService;

@Service("departmentService")
public class DepartmentServiceImpl implements DepartmentService
{
    @Resource(name = "departmentMapper")
    private DepartmentMapper departmentMapper;
    
    @Override
    public List<Department> getAllSchools() {
        return this.departmentMapper.selectAllSchools();
    }
    
    @Override
    public Department getSchoolByID(final Integer schoolid) {
        return this.departmentMapper.selectByPrimaryKey(schoolid);
    }
    
    @Override
    public int updateSchool(final Department department) {
        return this.departmentMapper.updateByPrimaryKeySelective(department);
    }
    
    @Override
    public List<Department> getAllSchoolsNoState() {
        return this.departmentMapper.selectAllSchoolsNoState();
    }
    
    @Override
    public int setSchool(final Department department) {
        return this.departmentMapper.insert(department);
    }
}
